The website <b><?=htmlentities($_SESSION['openid_trust_root'], ENT_QUOTES, 'UTF-8')?></b> has asked us for confirmation that <b><?=htmlentities($_SESSION['openid_identity'], ENT_QUOTES, 'UTF-8')?></b> is your identity URL.
<?php

if (isset($_SESSION['openid_sreg_policy_url']) && ($_SESSION['openid_sreg_policy_url'])) {
	?><br /><a href="<?=htmlentities($_SESSION['openid_sreg_policy_url'], ENT_QUOTES, 'UTF-8')?>">Policy URL</a><?
}

?>
<br /><br />


<form method="get" action="trust.php">
<div style="margin:10px 0 15px 0"><b>Select your identity : </b>
<select name="persona_id">
<?php

if (mysql_num_rows($list_personas) > 0) {
	while ($row = mysql_fetch_object($list_personas)) {
		?><option value="<?=htmlentities($row->persona_id, ENT_QUOTES, 'UTF-8')?>" <?php if (isset($_GET['persona_id']) && isset($row->persona_id) && ($_GET['persona_id'] == $row->persona_id)) echo 'selected="selected"'; ?>><?=htmlentities($row->persona_name, ENT_QUOTES, 'UTF-8')?> <? if (isset($row->default) && ($row->default == 1)) echo "(Default)"; ?></option><?
	}
}

?>
</select>
<input type="submit" value="OK" />
</div>
</form>



<form method="post" action="trust.php">
<input type="hidden" name="oit_action" value="trust" />

<table cellspacing="10" style="margin-bottom:10px">
<?php


if (isset($array_sreg_required) && in_array('nickname', $array_sreg_required)) {
	?><tr>
		<td><b>Nickname :<b/></td>
		<td><input type="hidden" name="oit_nickname" value="<?php if (isset($persona_default_nickname) && ($persona_default_nickname)) echo htmlentities($persona_default_nickname, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_nickname) && ($persona_default_nickname)) echo htmlentities($persona_default_nickname, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('nickname', $array_sreg_optional)) {
	?><tr>
		<td>Nickname (Optional) :</td>
		<td><input type="hidden" name="oit_nickname" value="<?php if (isset($persona_default_nickname) && ($persona_default_nickname)) echo htmlentities($persona_default_nickname, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_nickname) && ($persona_default_nickname)) echo htmlentities($persona_default_nickname, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}


if (isset($array_sreg_required) && in_array('fullname', $array_sreg_required)) {
	?><tr>
		<td><b>Fullname :<b/></td>
		<td><input type="hidden" name="oit_fullname" value="<?php if (isset($persona_default_fullname) && ($persona_default_fullname)) echo htmlentities($persona_default_fullname, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_fullname) && ($persona_default_fullname)) echo htmlentities($persona_default_fullname, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('fullname', $array_sreg_optional)) {
	?><tr>
		<td>Fullname (Optional) :</td>
		<td><input type="hidden" name="oit_fullname" value="<?php if (isset($persona_default_fullname) && ($persona_default_fullname)) echo htmlentities($persona_default_fullname, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_fullname) && ($persona_default_fullname)) echo htmlentities($persona_default_fullname, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}


if (isset($array_sreg_required) && in_array('email', $array_sreg_required)) {
	?><tr>
		<td><b>E-mail :<b/></td>
		<td><input type="hidden" name="oit_email" value="<?php if (isset($persona_default_email) && ($persona_default_email)) echo htmlentities($persona_default_email, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_email) && ($persona_default_email)) echo htmlentities($persona_default_email, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('email', $array_sreg_optional)) {
	?><tr>
		<td>E-mail (Optional) :</td>
		<td><input type="hidden" name="oit_email" value="<?php if (isset($persona_default_email) && ($persona_default_email)) echo htmlentities($persona_default_email, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_email) && ($persona_default_email)) echo htmlentities($persona_default_email, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}


if (isset($array_sreg_required) && in_array('dob', $array_sreg_required)) {
	?><tr>
		<td><b>Date of birth :<b/></td>
		<td><input type="hidden" name="oit_dob" value="<?php if (isset($persona_default_dob) && ($persona_default_dob)) echo htmlentities($persona_default_dob, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_dob) && ($persona_default_dob) && ($persona_default_dob != '0000-00-00')) echo htmlentities($persona_default_dob, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('dob', $array_sreg_optional)) {
	?><tr>
		<td>Date of birth (Optional) :</td>
		<td><input type="hidden" name="oit_dob" value="<?php if (isset($persona_default_dob) && ($persona_default_dob)) echo htmlentities($persona_default_dob, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_dob) && ($persona_default_dob) && ($persona_default_dob != '0000-00-00')) echo htmlentities($persona_default_dob, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}


if (isset($array_sreg_required) && in_array('gender', $array_sreg_required)) {
	?><tr>
		<td><b>Gender :<b/></td>
		<td><input type="hidden" name="oit_gender" value="<?php if (isset($persona_default_gender) && ($persona_default_gender)) echo htmlentities($persona_default_gender, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_gender) && ($persona_default_gender)) echo htmlentities($persona_default_gender, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('gender', $array_sreg_optional)) {
	?><tr>
		<td>Gender (Optional) :</td>
		<td><input type="hidden" name="oit_gender" value="<?php if (isset($persona_default_gender) && ($persona_default_gender)) echo htmlentities($persona_default_gender, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_gender) && ($persona_default_gender)) echo htmlentities($persona_default_gender, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}


if (isset($array_sreg_required) && in_array('postcode', $array_sreg_required)) {
	?><tr>
		<td><b>Postcode :<b/></td>
		<td><input type="hidden" name="oit_postcode" value="<?php if (isset($persona_default_postcode) && ($persona_default_postcode)) echo htmlentities($persona_default_postcode, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_postcode) && ($persona_default_postcode)) echo htmlentities($persona_default_postcode, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('postcode', $array_sreg_optional)) {
	?><tr>
		<td>Postcode (Optional) :</td>
		<td><input type="hidden" name="oit_postcode" value="<?php if (isset($persona_default_postcode) && ($persona_default_postcode)) echo htmlentities($persona_default_postcode, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_postcode) && ($persona_default_postcode)) echo htmlentities($persona_default_postcode, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}


if (isset($array_sreg_required) && in_array('country', $array_sreg_required)) {
	?><tr>
		<td><b>Country :<b/></td>
		<td><input type="hidden" name="oit_country" value="<?php if (isset($persona_default_country) && ($persona_default_country)) echo htmlentities($persona_default_country, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_country) && ($persona_default_country)) echo htmlentities($persona_default_country, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('country', $array_sreg_optional)) {
	?><tr>
		<td>Country (Optional) :</td>
		<td><input type="hidden" name="oit_country" value="<?php if (isset($persona_default_country) && ($persona_default_country)) echo htmlentities($persona_default_country, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_country) && ($persona_default_country)) echo htmlentities($persona_default_country, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}


if (isset($array_sreg_required) && in_array('language', $array_sreg_required)) {
	?><tr>
		<td><b>Language :<b/></td>
		<td><input type="hidden" name="oit_language" value="<?php if (isset($persona_default_language) && ($persona_default_language)) echo htmlentities($persona_default_language, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_language) && ($persona_default_language)) echo htmlentities($persona_default_language, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('language', $array_sreg_optional)) {
	?><tr>
		<td>Language (Optional) :</td>
		<td><input type="hidden" name="oit_language" value="<?php if (isset($persona_default_language) && ($persona_default_language)) echo htmlentities($persona_default_language, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_language) && ($persona_default_language)) echo htmlentities($persona_default_language, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}


if (isset($array_sreg_required) && in_array('timezone', $array_sreg_required)) {
	?><tr>
		<td><b>Timezone :<b/></td>
		<td><input type="hidden" name="oit_timezone" value="<?php if (isset($persona_default_timezone) && ($persona_default_timezone)) echo htmlentities($persona_default_timezone, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_timezone) && ($persona_default_timezone)) echo htmlentities($persona_default_timezone, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
} elseif (isset($array_sreg_optional) && in_array('timezone', $array_sreg_optional)) {
	?><tr>
		<td>Timezone (Optional) :</td>
		<td><input type="hidden" name="oit_timezone" value="<?php if (isset($persona_default_timezone) && ($persona_default_timezone)) echo htmlentities($persona_default_timezone, ENT_QUOTES, 'UTF-8'); ?>" /><?php if (isset($persona_default_timezone) && ($persona_default_timezone)) echo htmlentities($persona_default_timezone, ENT_QUOTES, 'UTF-8'); else echo "(Missing)"; ?></td>
	</tr><?
}

?>
</table>

<input type="submit" name="oit_submit" value="Allow Forever" />
<input type="submit" name="oit_submit" value="Allow Once" />
<input type="submit" name="oit_submit" value="Cancel" />
</form>
